package com.niiwoo.civet.trade.enums;

import com.niiwoo.tripod.provider.exception.NoSuchEnumValueException;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 贷款类型
 */
@Getter
@AllArgsConstructor
public enum LoanTypeEnum {
    SOCIAL_SECURITY_LOAN((byte) 1, "社保贷"),
    CREDIT_CARD_LOAN((byte) 2, "信用卡贷"),
    HOUSE_MORTGAGE_LOAN((byte) 3, "房抵贷"),
    VEHICLE_MORTGAGE_LOAN((byte) 4, "车抵贷"),
    SUPPLY_CHAIN_LOAN((byte) 5, "供应链贷"),
    SPEED_LOAN((byte) 6, "极速贷"),
    OTHER_LOAN((byte) 9, "其他"),
    CONSUME_LOAN((byte) 10, "消费贷"),
    BUSINESS_LOAN((byte) 11, "生意贷");


    private final Byte value;
    private final String desc;

    public static LoanTypeEnum enumOf(Byte value) {
        for (LoanTypeEnum typeEnum : values()) {
            if (typeEnum.value.equals(value)) {
                return typeEnum;
            }
        }
        throw new NoSuchEnumValueException("LoanTypeEnum:" + value);
    }

}
